import { createApp } from "vue";
import "./style.css";
import App from "./App.vue";
// import "@/styles/index.scss";
import "@/styles/tailwind.css";
import "@/styles/scrollbar.scss";
import { setupStore } from "./store";
import { setupRouter } from "./router";
import { setupI18n } from "./locales";
// import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
// import Avue from "@smallwei/avue";
// import "@smallwei/avue/lib/index.css";
// import "virtual:uno.css";
import { preloadIcons } from "./utils/iconify";
import registerComponents from "@/plugins/registerComponents";
import copy from "./dierctives/copy";

const app = createApp(App);

async function setupApp() {
  app.directive("copy", copy);
  app.use(registerComponents);
  preloadIcons();
  setupStore(app);
  setupRouter(app);
  await setupI18n(app);
  // app.use(ElementPlus);
  // app.use(Avue);
  app.mount("#app");
}

// loadLocalIcons().then(() => {
setupApp();
// });

export default app;
